<?php
namespace Common\Model;
use Think\Model;
class ShopModel extends Model{
	protected $_validate = array(
			array('username','require','用户名必须'),
			array('username','','用户名已存在',0,'unique',1),
			array('password','require','密码必须！'),
			array('shop_name','require','公司名称必须'),
			array('shop_name','','公司名称已存在',0,'unique',1),
			array('shop_address','require','请输入公司的地理位置'),
			array('east','require','请输入公司的位置的经纬度'),
			array('id_card_photo','require','身份证图片'),
			array('business_license_photo','require','营业执照图片'),
	);
	protected $_auto = array (
			array ('password','autopassword',3,'callback',1),
	);
	public function Ckpassword($data){
		if(empty($data['id'])){
			if(empty($data['password'])){
				return false;
			}else{
				return true;
			}
		}else{
			return true;
		}
	}
	public function autopassword($password){
		return md5($password."bxdadminshopping".$password);
	}
}